<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
<head py:strip=""/>

<body py:strip="">
<div id="AddActionBox" style="display: none;">
  <form action="/action/save" method="post">
    <fieldset>
      <legend>Create</legend>

        <input type="hidden" id="previousPage" name="previousPage" value="${previousPage}" />

        <!-- save-method is also used for update, so we give an empty action id -->
        <input type="hidden" id="id" name="id" value="" />
        <p>
          <label for="title">Title</label>
          <input type="text" id="title" name="title"/>
        </p>

        <p>
          <label for="notes">Notes</label>
          <textarea id="notes" name="notes"/>
            </p>
        <!-- From project page -->
        <div py:if="previousPage == 'kaizen.templates.viewProject'">
            <input type="hidden" id="projectId" name="projectId" value="${project.id}" />
            <p>
              <label for="contextId">Context</label>
              <select id="contextId" name="contextId">
                <option py:for="context in tg.contexts" value="${context.id}">${context.title}</option>

              </select>
            </p>
        </div>
        <!-- From context page -->
        <div py:if="previousPage == 'kaizen.templates.viewContext'">
            <input type="hidden" id="contextId" name="contextId" value="${context.id}" />
            <p>
              <label for="projectId">Project</label>
              <select id="projectId" name="projectId">
                <option value="">None</option>
                <option py:for="project in tg.projects" value="${project.id}">${project.title}</option>

              </select>
            </p>
        </div>

        <p>
          <label for="priority">Priority</label>
          <select id="priority" name="priority">
              <option py:for="priority in tg.priorities" value="${priority.value}">${priority.title}</option>
          </select>
        </p>

        <p><input type="hidden" id="tagsDelimited" name="tagsDelimited"/></p>
        <input type="submit" name="submit_createAction" value="Create"/>
        <input type="submit" onclick="toggle('AddActionBox'); return false;" value="Cancel"/>
      </fieldset>
  </form>
</div>
</body>
</html>
